import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[][] arr = new int[m][4];

        for (int i = 0; i < m; i++) {
            for (int j = 0; j < 4; j++) {
                arr[i][j] = scanner.nextInt();
            }
        }

        Solution solution = new Solution();
        int[][] res = solution.rangeAddQueries(n,arr);
        for (int i = 0; i < res.length; i++) {
            for (int j = 0; j < res[i].length; j++) {
                System.out.print(res[i][j] + " ");
            }
            System.out.println();
        }

    }
}

class Solution {
    public int[][] rangeAddQueries(int n, int[][] queries) {
        int[][] ans = new int[n][n];

        for (int i = 0; i < queries.length; i++) {
            for (int j = queries[i][0]; j <= queries[i][2]; j++) {
                for (int k = queries[i][1]; k <= queries[i][3]; k++) {
                    ans[j][k]++;
                }
            }
        }
        return ans;
    }
}